<!DOCTYPE html>
<html lang="en">

    <head>
        <meta charset="UTF-8" />
        <link rel="stylesheet" href="styles/style.css">
        <link rel="stylesheet" href="styles/theme/atom-one-dark.css">
        <title>例子48-ES6/7常用语法介绍</title>
    </head>

    <body>
        <pre>
            <code>
                // 例子48

                // profile.js
                export var firstName = 'Michael';
                export var lastName = 'Jackson';
                export var year = 1958;
                export function multiply(x, y) {
                return x * y;
                };
                export class Point {
                    constructor(x, y) {
                        this.x = x;
                        this.y = y;
                    }
                }

                // 或者写成
                var firstName = 'Michael';
                var lastName = 'Jackson';
                var year = 1958;
                function multiply(x, y) {
                    return x * y;
                }
                class Point {
                    constructor(x, y) {
                        this.x = x;
                        this.y = y;
                    }
                }

                export {
                    firstName,
                    lastName,
                    year,
                    mul as multiply,
                    Point
                };

                //--------------------------------------------------------------------------

                // export-default.js
                export default function () {
                    console.log('foo');
                }
            </code>
        </pre>
        <script src="scripts/libs/highlight.pack.js"></script>
        <script src="scripts/48.js"></script>
        <script>
            hljs.initHighlightingOnLoad();
        </script>
    </body>

</html>